﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using hbse.Entities;
using NHibernate;
using hbse.DTO;

namespace hbse.Service
{
    public class NamePlateCoreService
    {
        public int AddNamePlateCore(NameplateCore newNameplateCore, ISession session)
        {
            int result = -1;

            using (ITransaction tx = session.BeginTransaction())
            {
                session.Save(newNameplateCore);
                session.Flush();
                tx.Commit();
                result = 1;
            }

            return result;

        }
        public int UpdateNamePlateCore(NameplateCore updateNameplateCore, ISession session)
        {
            int result = -1;

            using (ITransaction tx = session.BeginTransaction())
            {
                session.SaveOrUpdate(updateNameplateCore);
                session.Flush();
                tx.Commit();
                result = 1;
            }

            return result;

        }


    }
}
